﻿using System;
using ResourceLoader.CustomTest;

namespace ResourceLoader
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("请输入对应测试码（测试前请清理系统缓存sudo purge）");
            Console.WriteLine("0：测试文件是否存在查询");
            Console.WriteLine("1：测试单个文件100M");
            Console.WriteLine("2：测试加载1000个1M文件");
            Console.WriteLine("3：测试加载10000个0.1M文件");
            string s = Console.ReadLine();
            if (s != null)
            {
                switch (s)
                {
                    case "0": //测试文件是否存在查询
                        Test.Init();
                        int fileCount = 1000000;
                        Test.TestExistAPI(fileCount);
                        Test.TestSysExistAPI(fileCount);
                        break;
                    case "1": //测试单个文件100M
                        Test.TestLoadResPackageAllFiles(
                            "/Users/panjianbo/Documents/projects/panjianbo_10days_project.git/test/single_pack/1_100M.pk",
                            100000000, 1);
                        break;
                    case "2": //测试加载1000个1M文件
                        Test.TestLoadResPackageAllFiles(
                            "/Users/panjianbo/Documents/projects/panjianbo_10days_project.git/test/single_pack/1000_1M.pk",
                            1000000, 1000);
                        break;
                    case "3": //测试加载10000个0.1M文件
                        Test.TestLoadResPackageAllFiles(
                            "/Users/panjianbo/Documents/projects/panjianbo_10days_project.git/test/single_pack/10000_100K.pk",
                            100000, 10000);
                        break;
                }
            }
        }
    }
}